def login():
    correct_user = "Colin"
    correct_password = "123456"

    error_count = 0
    max_attempts = 3

    while error_count < max_attempts:

        username = input("请输入用户名：")
        password = input("请输入密码：")


        if username == correct_user and password == correct_password:
            print("登录成功！")
            break 
        else:
            error_count += 1
            remaining_attempts = max_attempts - error_count

            if error_count < max_attempts:
                print(f"用户名或密码错误！还剩{remaining_attempts}次机会")
            else:
                print("账号已锁定！")
                break